<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function test() {
            console.log(arguments.length)
        }

        test.apply(null, [1, 2, 3]) // 3
        test([1, 2, 3]) // 1

        function sum1(a, b, c = 1) {
            console.log(a, b, c)
        }

        const getSum = (a, b, c = 1) => {
            console.log(a, b, c)
        }

        sum1(...[1, 2]) // 1, 2, 1
        sum1(...[1, 2, 3]) // 1, 2, 3
        getSum(...[1, 2]) // 1, 2, 1
        getSum(...[1, 2, 3]) // 1, 2, 3

        function getSum1(...values) {
            console.log(values)
        }
        getSum1(1, 2, 3) // [1,2,3]
    </script>
</body>

</html>